package com.trdcore.zyzkt.controller;


import com.trdcore.zyzkt.resp.ResultData;
import com.trdcore.zyzkt.service.FileService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@Tag(name = "文件上传接口")
@RequestMapping("/admin/vod/file")

public class FileUploadController {

    @Autowired
    private FileService fileService;

    @Operation(summary = "文件上传",description = "文件上传")
    @PostMapping("/upload")
    public ResultData uploadFile(@RequestParam("file") MultipartFile file){
        String url=fileService.upload(file);
        return ResultData.success(url).setMessage("文件上传成功");
    }
}
